package com.apop.hrss.home.componet;

import com.apop.common.config.action.Action;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Jiayi Zheng
 * @version V1.0
 * @ClassName ParamsProcessor
 * @date 2021/11/9  15:23
 * @Description: 入参处理器
 */
@Service
@Slf4j
public class ParamsProcessor {

    public Map<String,Object> proc117(Action action,Map<String,Object> paramMap){
        log.debug("原始参数 >>>>>>>>>>>>>>>>>");
        log.debug("{} ",paramMap);
        List<Map<String, Object>> paramMapList = new ArrayList<>();

        String formId = null;
        for (String paramMapKeyName :paramMap.keySet()){
            Map<String, Object> paraMaps = new HashMap<>();
            log.debug(paramMapKeyName);
            paraMaps.put("tableName",paramMapKeyName);
            paraMaps.put("columns",paramMap.get(paramMapKeyName));
            paramMapList.add(paraMaps);

            // 如果是formId 赋值 给扩展参数 并且不添加到表单
        }


        log.debug("处理后参数 >>>>>>>>>>>>>>>>>");
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("forms",paramMapList);
        log.debug("{} ",resultMap);
        return resultMap;
    }
}
